package pl.ericpol.kernel.pool;

import java.util.List;

import pl.ericpol.environment.sensors.Sensor;

public class SensorPool {
	
	private List<Sensor> sensors;

	public SensorPool(List<Sensor> sensors) {
		this.sensors = sensors;
	}

	public List<Sensor> getSensors() {
		return sensors;
	}

	public void setSensors(List<Sensor> sensors) {
		this.sensors = sensors;
	}
	
	public Sensor getSensorById(int id) {
		Sensor resultSensor = null;
		for (Sensor sensor: sensors)
			if (sensor.getId()==id) {
				resultSensor = sensor;
				break;
			}
		return resultSensor;
	}
	
	public void addSensor(Sensor sensor) {
		sensors.add(sensor);
	}
 
}
